<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('报价')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content" >
        <form class="form-horizontal m" id="form-ytendereqe-edit" th:object="${ytendereqe}">
            <div class="col-md-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">供货尺寸：</label>
                    <div class="col-sm-9">
                        <input name="yghcc" id="yghcc" th:field="*{yghcc}" class="form-control" type="text" required>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">报价：</label>
                    <div class="col-sm-9">
                        <input name="ypri0" id="ypri0" th:field="*{ypri0}" class="form-control" type="text" oninput="updateAmount()" required>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label ">总金额：</label>
                    <div class="col-sm-9">
                        <input name="yzamt" id="yzamt" th:field="*{yzamt}" class="form-control" type="text" readonly>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">材料编码：</label>
                    <div class="col-sm-9">
                        <input name="yitm0" th:field="*{yitm0}" class="form-control" type="text" readonly>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">规格型号：</label>
                    <div class="col-sm-9">
                        <input name="yitm0" th:field="*{yggxx}" class="form-control" type="text" readonly>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">招标单位：</label>
                    <div class="col-sm-9">
                        <input name="stu" id="stu" th:field="*{stu}" class="form-control" type="text" readonly>
                    </div>
                </div>
            </div>
            <div class="col-md-6">
                <input name="id" th:field="*{id}" type="hidden">
                <div class="form-group">
                    <label class="col-sm-3 control-label ">单号：</label>
                    <div class="col-sm-9">
                        <input name="ynum0" th:field="*{ynum0}" class="form-control" type="text" readonly>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">材料名称：</label>
                    <div class="col-sm-9">
                        <input name="yitm0" th:field="*{itmdes1}" class="form-control" type="text" readonly>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">材质牌号：</label>
                    <div class="col-sm-9">
                        <input name="yitm0" th:field="*{yczph}" class="form-control" type="text" readonly>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">需求数量：</label>
                    <div class="col-sm-9">
                        <input name="yqty" id="yqty" th:field="*{yqty}" class="form-control" type="text" readonly>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">技术标准：</label>
                    <div class="col-sm-9">
                        <input name="yitm0" th:field="*{yjsbz}" class="form-control" type="text" readonly>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "system/ytendereqe";
        $("#form-ytendereqe-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-ytendereqe-edit').serialize());
            }
        };

        function updateAmount() {
            var ypri = document.getElementById('ypri0').value;
            var yqty = document.getElementById('yqty').value;
            var yamt = parseFloat(ypri) * parseFloat(yqty);
            document.getElementById('yzamt').value = yamt.toFixed(2);
            console.log("ypri:"+ypri);
            console.log("yqty:"+yqty);
            console.log("yamt:"+yamt);
        }
    </script>
</body>
</html>
